<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
       /* 
            实现参数的自增：
            tmp1++ 等价于 tmp1 = tmp1 + 1
            ++tmp1 等价于 tmp1 = tmp1 + 1
        */  

        var tmp1 = 100;
        console.log(tmp1);
        // tmp1 = tmp1 + 1
        // tmp1++;
        ++tmp1;
        console.log(tmp1)

        /*
          tmp2++  + 1
          先和 +1 进行运算然后再自增返回结果
        */
        var tmp2 = 200;
        console.log(tmp2++ + 1) //201
        var tmp22 = tmp2++ + 1
        console.log(tmp22);  //202

        /*
          ++tmp3  + 1
          先自增+1 再和后面的 +1 进行运算 = 302
         */
        
        var tmp3 = 300;
        console.log(++tmp3 + 1)  //302
        console.log(tmp3);       //301
    </script>
</head>
<body>
    
</body>
</html>